[% setvar title Filehandles should use C<*> as a type prefix if typeglobs are eliminated. %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Filehandles should use <code>*</code> as a type prefix if typeglobs are eliminated.</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Peter Scott &lt;<a href='mailto:peter@psdt.com'>peter@psdt.com</a>&gt;
  Date: 5 Aug 2000
  Mailing List: <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a>
  Number: 10
  Version: 3
  Status: Retracted</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>Version 1 of this RFC stated: &quot;The lack of a type-defining punctuation
character prefix for filehandles makes them second-class variables in Perl.
If typeglobs are eliminated in Perl 6, the <code>*</code> character would become
available as a type prefix character and could be used for filehandles.&quot;</p>
<p>Versions 2 and 3 withdraw this request, contingent upon the removal of
bareword filehandles in Perl 6.  If scalars or objects in scalars (<code>$fh</code>)
are used for filehandles everywhere then there is no need to make a new
type out of them.  The rest of the original RFC is left below for archival
purposes.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>To pass filehandles around one either has to use a typeglob (<code>local *FH</code>)
or put them in a scalar (<code>my $fh = new FileHandle</code> or the 5.6 <code>open $fh,
...</code>), at which point you can't tell that they're filehandles without the
right context.</p>
<p>There have been serious proposals to eliminate typeglobs in Perl 6. If they
get axed, the <code>*</code> character could be reused for another datatype and the
filehandle is fortuitously closely related.</p>
<p>The mental jump is fairly small, since most people other than module
developers only ever saw <code>*</code> used for filehandles anyway:</p>
<pre>     local *FH;
     open (FH, ...);</pre>
<p>This proposal would change that to</p>
<pre>     open (my *fh, ...);</pre>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>Backwards compatibility takes a hit unless the current filehandle syntax is
grandfathered in; I am not taking a position on whether it should be. Since
it is contingent upon typeglobs being eliminated, it won't break any
existing code that already uses typeglobs that won't be broken anyway.</p>
<p>Use of <code>readline</code>s will now look like</p>
<pre>     while (&lt;*fh&gt;) { ...</pre>
<p>which means that the use of the angle operator for globbing also has to go.
As if an excuse were needed.</p>
<p>This proposal also applies to directory handles.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p><i><a href='http://search.cpan.org/perldoc?perlopentut'>perlopentut</a></i></p>
</div>
